<%@ include file="../common2.jspf"%>
<script type="text/javascript">
	/*
	$(document).ready(function() {
		$('#category\\.categoryNO').change(appendSubCategoryList);
	});
	
	var appendSubCategoryList = function() {
		var url = '${pageContext.request.contextPath}/category/list';
		var data = {parentNO: $(this).val()};
		var success = function(data) {
			if (data.length > 0)
				var select = $('<select>');
			
			for (var i = 0; i < data.length; i++) {
				var option = $('<option>');
				option.text(data[i].name);
				option.val(data[i].categoryNo);
				select.append(option);
			}
			
			$('#category\\.categoryNO').after(select);
		}
		$.post(url, data, success, 'json');
	}
	 */
</script>

<article class="content">
	<form:form modelAttribute="note">
		<p>
			<form:errors path="*" cssClass="errors" />
		</p>
		<p>
			<form:select path="category.categoryNO">
				<form:options items="${categoryList}" itemValue="categoryNO" itemLabel="name" />
			</form:select>
			<form:input path="subject" size="40" />
		</p>
		<p>
			<form:textarea path="content" rows="20" cssStyle="width:98%;" />
		</p>
		<p>
			<button type="submit" onClick="$('#note').submit();">
				<fmt:message key="save" />
			</button>
			<button type="button" onClick="history.go(-1);">
				<fmt:message key="cancel" />
			</button>
		</p>
	</form:form>
</article>